package com.leixin.utils.generator;

import com.baomidou.mybatisplus.annotation.DbType;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @Description: TODO
 * @Company : TODO
 * @Date : 2020-05-02.
 * @Author : LeiXin
 */
@Data
@Accessors(chain = true)
public class Generator {

    // 模块名称
    private String moduleName;
    // 数据库
    private GeneratorDataSource dataSource;
    // 作者
    private String author = "xin.lei";
    // 包名称
    private String packageName = "com.lx";

    private String[] tableNames;

    // 是否添加 createTime,updateTime 等公共字段
    private boolean tableFill = false;
    /**
     * 是否覆盖已有文件
     */
    private boolean fileOverride;

    /**
     * 开启 swagger2 模式
     */
    private boolean swagger2 = false;
    private boolean validated = false;

    /**
     * 开启 构件测试类
     */
    private boolean testFlag = false;

    /**
     * 开启 excel 接口生成
     */
    private boolean xls = false;

    /**
     * 开启 cicd 生成
     */
    private boolean cicd = false;
    private boolean mavenPom = false;
    private boolean feign = false;
    private boolean springboot = false;

    /**
     * <b>是否分离 Pojo 工程</b>
     */
    private boolean pojoSeparate = false;
    /**
     * <b>是否启用实体类 Lombok</b>
     */
    private boolean entityLombokModel = false;
    /**
     * 注册中心配置
     */
    private String nacosPath = "127.0.0.1:8848";

    /**
     * <b>Pojo 工程名称</b>
     */
    private String pojoProjectName;
    private String feignProjectName;

    /**
     * <b>表前缀</b>
     */
    private String tablePrefix = "";
    /**
     * <b>字段名前缀</b>
     */
    private String tableFieldPrefix = "";

    @Data
    @Accessors(chain = true)
    public static class GeneratorDataSource {
        private String ip = "127.0.0.1";
        private String port = "3306";
        private String database = "mysql";
        private String userName = "root";
        private String password = "123456";
        private String sqliteFileUrl = "";
        private DbType dbType = DbType.MYSQL;
    }
}
